const codeMapping = {
    0:'OK',
    1:'NO'
};

export default {
    ok:(data)=>{
        return {
            code:0,
            msg:'OK',
            ...data
        }
    },
    exception:(data, code)=>{
        return {
            code:code,
            msg:codeMapping[this.code],
            ...data
        }
    },
    no:(data)=>{
        return {
            code:1,
            msg:'Error',
            ...data
        }
    }
}
